package com.twxm.breed.entity;

import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;

import java.util.Date;

@Data
@Table(name = "dissolvedoxygen")
public class DissolvedOxygen implements FactorImpl{
    @IsKey
    @IsAutoIncrement
    private int oxygenId;

    @Column(comment = "溶氧量",type = MySqlTypeConstant.FLOAT,decimalLength = 2)
    @IsNotNull
    private float oxygenContent;

    @Column(comment = "采集时间",type = MySqlTypeConstant.DATETIME)
    @IsNotNull
    private Date collectionTime;

    @Column(name = "pond_id",type = MySqlTypeConstant.VARCHAR)
    @IsNotNull
    private FishPond fishPond;

    public DissolvedOxygen(float oxygen, Date date, FishPond fishPond) {
        this.oxygenContent = oxygen;
        this.collectionTime = date;
        this.fishPond = fishPond;
    }

    @Override
    public float getContent(String el) {
        return oxygenContent;
    }
}
